import { Window_Base } from "@/windows/Window_Base.js";

export class Window_SkillStatus extends Window_Base {
    constructor(width,height) {
        super(width, height);
        this._actor = null;
    }
    destroy(opts){
        super.destroy(opts);
        this._actor=null;
    }

    setActor(actor) {
        if (this._actor !== actor) {
            this._actor = actor;
            this.refresh();
        }
    }

    refresh() {
        this.contents.clear();
        if (this._actor) {
            let w = this.contentsWidth();
            let h = this.contentsHeight();
            let y = h / 2 - this.lineHeight() * 1.5;
            let width = w - 162 - this.textPadding();
            this.drawActorFace(this._actor, 0, 0, 144, h);
            this.drawActorSimpleStatus(this._actor, 162, y, width);
        }
    }
}